import request from '@/utils/request.js'

/**
 * 获取所有部门
 * @returns promise
 */
export function getDepartment() {
  return request({
    url: '/company/department'
  })
}

export function delDeptById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'DELETE'
  })
}

export function addDept(data) {
  return request({
    url: '/company/department',
    method: 'POST',
    data
  })
}

export function updateDepartment(data) {
  return request({
    url: '/company/department/' + data.id,
    method: 'PUT',
    data
  })
}
